package com.zjw.core.algorithm;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;

public class Top10Number {

    public static void main(String[] args) {
        int[] num = new int[1000000];
        Map<Integer,Integer> topMap = new HashMap<>();
        for (int i = 0; i < 1000000; i++) {
            num[i] = (int) (Math.random()* 500);
        }

        Long startTime = System.currentTimeMillis();
        for (int i = 0; i < num.length; i++) {
            for (int j = i + 1; i < num.length; i++) {
                if(num[j] > num[i]){
                    int temp = num[j];
                    num[j] = num[i];
                    num[i] = temp;
                }
            }
        }
        Long endTime = System.currentTimeMillis();

//        for (int i = 0; i < 100; i++) {
//            System.out.println("最大的100个值"+num[i]);
//        }
        System.out.println("耗时:"+ (endTime - startTime)+"毫秒");
    }
    
}
